<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增供应商')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-supplier-add">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">供应商编号：</label>
            <div class="col-sm-8">
                <input name="supplierCode" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">供应商名称：</label>
            <div class="col-sm-8">
                <input name="supplierName" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">供应商类型：</label>
            <div class="col-sm-8">
                <select name="supplierType" class="form-control m-b" th:with="type=${@dict.getType('supplier_type')}" required>
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">联系人：</label>
            <div class="col-sm-8">
                <input name="linkMan" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">联系电话：</label>
            <div class="col-sm-8">
                <input name="linkTel" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">联系地址：</label>
            <div class="col-sm-8">
                <input name="linkAddress" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">供应商状态：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('supplier_status')}">
                    <input type="radio" th:id="${'supplierStatus_' + dict.dictCode}" name="supplierStatus" th:value="${dict.dictValue}" th:checked="${dict.default}" required>
                    <label th:for="${'supplierStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = ctx + "system/supplier"
    $("#form-supplier-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-supplier-add').serialize());
        }
    }
</script>
</body>
</html>